package com.shopping.user.controller;

import com.shopping.entity.Result;
import com.shopping.entity.StatusCode;
import com.shopping.user.pojo.User;
import com.shopping.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author liaokang
 * @version 1.0
 * @date 2020/6/3 19:11
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping
    public Result findUserByU_name(@PathVariable String u_name){
        User u = userService.findUserByU_name(u_name);
        return new Result(true, StatusCode.OK, "查询成功",u);
    }
}
